<?php

class Application_Form_NewActivityForm extends Zend_Dojo_Form {

    public function init() {
        $this->setAction('save');
        $this->setMethod('post');

        $this->setAttrib('class', 'well');

        $name = $this->addElement('text', 'name', array(
            'required' => true,
            'class' => 'input-small span3',
            'placeholder' => '',
            'label' => 'Nombre de actividad:'
                ));

        $description = $this->addElement('text', 'description', array(
            'required' => true,
            'class' => 'input-small span3',
            'placeholder' => '',
            'label' => 'Descripcion:'
                ));

        $time = $this->addElement('text', 'planned_time', array(
            'validators' => array(
                'int',
                array('StringLength', false, array(1, 8)),
            ),
            'required' => true,
            'class' => 'input-small span3',
            'placeholder' => '',
            'label' => 'Tiempo Planeado (min):'
                ));

        $startDate = $this->addElement('text', 'start_date', array(
            'required' => true,
            'class' => 'input-small span3',
            'placeholder' => '',
            'readonly' => 'readonly',
            'label' => 'Fecha de inicio:'
                ));

        $endDate = $this->addElement('text', 'end_date', array(
            'required' => true,
            'class' => 'input-small span3',
            'placeholder' => '',
            'readonly' => 'readonly',
            'label' => 'Fecha de fin:'
                ));

        $saveButton = $this->addElement('submit', 'save', array(
            'required' => false,
            'ignore' => true,
            'label' => 'Guardar',
            'class' => 'btn'
                ));

        // We want to display a 'failed authentication' message if necessary;
        // we'll do that with the form 'description', so we need to add that
        // decorator.
        $this->setDecorators(array(
            'FormElements',
            array('HtmlTag', array('tag' => 'dl', 'class' => 'zend_form')),
            array('Description', array('placement' => 'prepend')),
            'Form'
        ));
    }

}